-
Notifications
You must be signed in to change notification settings - Fork 17.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AP_RangeFinder: No specification of baud rate #14808
AP_RangeFinder: No specification of baud rate #14808
Conversation
Does this mean that the "initial_baudrate" feature is not working? I think the purpose of this feature is to default the serial baud rate to the rate that the rangefinder supports. It should allow easier setup. |
Won't this break everybody's existing, working rangefinder setups? |
@peterbarker san, @rmackay9 san. I checked the operation on my GY-US42v2 serial device. I learned that if the baud rate specification in the uart->begin method is 0, it does not update the value of the internal variable baud rate. ChibiOS UARTDriver.cpp: |
On Tue, 14 Jul 2020, murata,katsutoshi wrote:
@peterbarker san. I checked the operation on my GY-US42v2 serial device.
I learned that if the baud rate specification in the uart->begin method is 0, it does not update the value of the internal variable baud rate.
I set the baud rate to 9 for this PR change and the config parameter SERIALx.
I was able to verify that the distance changes in the MAVLINK inspector.
If we merge this - will some people's rangefinders stop working until they
set the baudrate parameter?
|
If uartdriver is correct, you should be able to use it normally. The wiki describes setting the baud rate of the serialx configuration parameter. The end user does not know that you are setting the baud rate in the range finder. Unless I wrote it on the wiki, I wouldn't know until I looked at the source. I looked at the source and expected it to be reset. However, since it has not been reconfigured, I think that returning to the wiki specifications will eliminate misunderstandings by developers. I have confirmed that setting the baud rate to 0 will use the existing baud rate. If anything other than chibios occurs, I think there is a bug in the uartdriver. |
On Thu, 16 Jul 2020, murata,katsutoshi wrote:
If uartdriver is correct, you should be able to use it normally. The wiki describes setting the baud rate of the serialx configuration parameter. The end
user does not know that you are setting the baud rate in the range finder. Unless I wrote it on the wiki, I wouldn't know until I looked at the source. I
looked at the source and expected it to be reset. However, since it has not been reconfigured, I think that returning to the wiki specifications will
eliminate misunderstandings by developers.
My understanding, then, is that this PR /will/ break many, many setups.
The decision was made a long time ago to have things "just work" in terms
of baudrates for many things.
Changing this now will cause way too much breakage and user support IMO.
I don't know if we need to poke the Wiki to say that the baudrate is
automatically set on some of these backends. @Hwurzburg?
|
I dont have an issue if we wish to add that kind of wiki note...but its going to be many many places..... in general if we dont say you need to set something, then you dont need to set it....like in the telem protocols...many ignore the baud rate setting...but we tell people to use this, you need to set x,y,z...if w param is ignored, we dont say its ignored, its just not mentioned....many other examples...like serial options, rc options, often I2C addresses,etc...even baud rate on SERIAL0 when its USB...the list is almost endless... |
I have been using the initial_baudrate of this driver on GY-US42v2 serial I learned that the method is not called. |
OK, this is definitely going ot break things. If a specific driver needs to use 0 here for some reason it could by overriding initial_baudrate. This is also relying on behaviour I'd like to remove from the serial manager - having it do the initial baud/buffer set up. Closing this one. |
I found out that the UART->begin baud rate re-set doesn't work.
I looked at the source and misunderstood that it would be reconfigured.
I think it would be better to limit the buffer size specification to TX and RX.
I would set the baud rate setting to 0.
I would set the baud rate value to the SERIALx baud rate in the config parameter, if this feature is enabled. There is no need to set the It also eliminates the need to describe the WIKI baud rate.
#14796